package com.example.xgakj.mvp_demo.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class TimeUtil
{
	/**
	 * ��õ�ǰʱ��
	 * @return  2011-06-07
	 */
	public static String getCurrDate(){
		Date aDate = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
		String formattedDate = formatter.format(aDate);
		return formattedDate; 
	}
	
	public static String getCurrDateTime(){
		Date aDate = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String formattedDate = formatter.format(aDate);
		return formattedDate; 
	}
	public static String getCurrDateTime2(){
		Date aDate = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
		String formattedDate = formatter.format(aDate);
		return formattedDate; 
	}
	public static String getCurrDateTime3(){
		Date aDate = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
		String formattedDate = formatter.format(aDate);
		return formattedDate;
	}
	
	public static String ConvertDate(String arg0){
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Calendar calendar = Calendar.getInstance();
	    calendar.setTimeInMillis(Long.valueOf(arg0));
	    return formatter.format(calendar.getTime());
		
	}
}
